﻿Imports Mystery

Public Class EventDetails

    Private _event_guid As Guid

    Public Sub New(myEvent As UserEvent)

        InitializeComponent()

        _event_guid = myEvent.guid

        lDate.Content = myEvent.event_date.value.ToString
        lTitle.Content = myEvent.title.value
        If myEvent.content.value IsNot Nothing Then
            Dim content As IContent = myEvent.content.value
            Dim cb As IContentButton = content.GetType.getMysteryAttribute(Of ContentButtonAttribute)().createButton(content)
            gContent.Children.Add(cb.getStakPanel(50))
        End If

    End Sub

    Public Event done()


    Private Sub bOk_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles bOk.Click
        RaiseEvent done()
    End Sub

    Private Sub bDismiss_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles bDismiss.Click
        Dim cd As IContentDispatcher = getGlobalObject(Of IContentDispatcher)()
        cd.Remove(cd.getContent(Of UserEvent)(_event_guid))
        RaiseEvent done()
    End Sub
End Class
